package ${packageName}.${moduleName}.service;

import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import ${packageName}.${moduleName}.entity.${modelName};
import ${packageName}.${moduleName}.mapper.${modelName}Mapper;
import javax.annotation.Resource;

/**
 * ${modelDesc} Service类
 * @author ${author!"habitplus"}, created at ${.now?string["yyyy/MM/DD HH:mm:ss.SSS"]}
 */
@Service
public class ${modelName}Service {

    @Resource
    private ${modelName}Mapper mapper;

    @Transactional
    public void save(${modelName} entity){
        mapper.add(entity);
    }

    @Transactional
    public void delete(String id){
        mapper.delete(id);
    }

    @Transactional
    public void update(${modelName} entity){
        mapper.update(entity);
    }

    public ${modelName} get(String id){
        return mapper.get(id);
    }

    public List<${modelName}> listAll(){
        return mapper.listAll();
    }

    public List<${modelName}> select(Map<String,Object> condition){
        return mapper.select(condition);
    }
}
